import matplotlib.pyplot as plt
import numpy as np

plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False

x = np.linspace(0, 10, 100)
y1 = np.sin(x)
y2 = np.cos(x)

plt.figure(figsize=(10, 6))
plt.plot(x, y1, label='sin(x)', color='green', linestyle='-', linewidth=2)
plt.plot(x, y2, label='cos(x)', color='#F00', linestyle='--', linewidth=2)

plt.title('折线图')
plt.xlabel('x')
plt.ylabel('y')
plt.legend(loc='lower left')
plt.grid(True, linestyle=':')
plt.show()
